/**
 * @file log_custom_tiling.cpp
 *
 * Copyright (C) 2025. Huawei Technologies Co., Ltd. All rights reserved.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */
#include <cassert>
#include <cstddef>
#include "nms_with_mask_custom_tiling.h"

// float
constexpr uint32_t BLOCK_SIZE = 32;


void GenerateTilingData(uint8_t *tilingBuf, uint32_t blockDim)
{
    uint32_t totalNum;
    uint32_t totalNumAlign32;
    uint32_t socreNumAlign32;
    uint32_t outNumAlign32;


    NMSWithMaskCustomTilingData *tiling = reinterpret_cast<NMSWithMaskCustomTilingData *>(tilingBuf);

    totalNum = tiling->totalNum;

    totalNumAlign32 = (totalNum * sizeof(float)  + 31 ) / 32 * 32 / sizeof(float);
    socreNumAlign32= (totalNum  / 4 * sizeof(float)  + 31 ) / 32 * 32 / sizeof(float);//一个框两个坐标四个输入
    outNumAlign32= (totalNum / 4 * sizeof(float)  + 31 ) / 32 * 32 / sizeof(uint8_t);

    tiling->totalNumAlign32 = totalNumAlign32;
    tiling->socreNumAlign32 = socreNumAlign32;
    tiling->outNumAlign32 = outNumAlign32;


    (void)blockDim;
}